#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
-------------------------------------------------
   File Name：    input_page.py
   Author :       zyq
   CreateDate：   2024/8/2 12:56
   Remark :  输入文字页面
-------------------------------------------------
"""

from guitesting.common.bash.bash_ui.page_element import PageElement, BasePage


class InputPage(BasePage):
    url = "http://xn--6frwj470ei1s2kl.com/demo/input"

    input_1 = PageElement(xpath="""/html/body/div[1]/div/div/main/div/label[1]/div/div/div/input""")
    input_2 = PageElement(xpath="""/html/body/div[1]/div/div/main/div/label[2]/div/div/div/input""")
    input_number_1 = PageElement(xpath="""/html/body/div[1]/div/div/main/div/label[3]/div/div/div/input""")

    def open_url(self):
        """
        打开页面
        :return: None
        """
        self.get_url(self.url)

    def input_text(self, content: str):
        """
        输入文字
        :param content: 输入内容
        :return: None
        """
        self.input_1 = content
        self.input_2 = content

    def input_number(self, content: int):
        self.input_number_1.input_text(content=content)
